<template>
  <div id="role">
    <el-button type="primary" @click="roleAdd">添加</el-button>
      <v-add :obj="obj" ref="bb"></v-add>
      <v-list @edit="edit" ></v-list>
  </div>
</template>
<script>
import vAdd from "./components/add.vue"
import vList from "./components/list.vue"
export default {
  data() {
    return {
      obj:{
        istrue:false,
        isadd:true
      }
    };
  },
  methods: {
    roleAdd(){
      this.obj.istrue=true
    },
    edit(id){
      this.obj.istrue=true,
      this.obj.isadd=false,
      this.$refs.bb.getone(id)
    }
  },
  components: {
    vList,
    vAdd
  },
  mounted() {},
  destroyed() {},
};
</script>
<style>
</style>